type IBlurWrapperProps = {
  onChange?: (value: string) => void;
  render: (props: { onBlur: (e: any) => void }) => React.ReactNode;
};

export const BlurWrapper = ({ render, onChange }: IBlurWrapperProps) => {
  const onBlur = (e: any) => {
    if (typeof onChange === 'function') onChange(e.target.value);
  };

  return render({ onBlur });
};
